{// 引入标签库 }
<tagLib name="html" />
<include file="Public:header" />
<load href='__TMPL__Common/js/jquery.bgiframe.js' />
<load href='__TMPL__Common/js/jquery.weebox.js' />
<load href='__TMPL__Common/style/weebox.css' />
<php>
	function show_deal($name,$deal_id){
		return '<a href="__ROOT__/index.php?ctl=deal&id='.$deal_id.'" target="_blank">'.$name.'</a>';
	}
	function get_transfer_status($status,$t_user_id){
		if($t_user_id > 0){
			return '已转让';
		}
		elseif($status == 0){
			return '已撤销';
		}
		else
			return '转让中';
	}
	function transfer_reback($id,$transfer){
		if($transfer['status'] > 0 && $transfer['t_user_id']==0){
			return '<a href="javascript:reback('.$id.');">撤销</a>';
		}
	}
</php>
<div class="main">
<div class="main_title">{$main_title}</div>
<div class="blank5"></div>
<html:list 
	id="dataTable" 
	style="dataTable" 
	name="transfer" 
	action="true" 
	datasource="list" 
	show="id:{%ID}|50px,name|show_deal=$transfer['deal_id']:原始标,user_id|get_user_name:转让者,t_user_id|get_user_name:承接者,transfer_time|to_date:承接时间,transfer_amount|format_price:转让价格,transfer_number:转让期数,create_time|to_date:发布时间,status|get_transfer_status=$transfer['t_user_id']:状态" 
	actionlist="vdetail:详情,id|transfer_reback=$transfer" /> 

<div class="blank5"></div>
<div class="page">{$page}</div>
</div>
<script type="">
	function vdetail(id){
		window.open("__ROOT__/index.php?ctl=transfer&act=detail&id="+id);
	}
	function reback(id){
		$.ajax({
			url:ROOT+'?m=Transfer&a=reback&id='+id,
			dataType:"json",
			success:function(ajaxobj){
				if(ajaxobj.status == 1){
					$.weeboxs.open(ajaxobj.info, {contentType:'html',showButton:false,title:"撤销转让",width:600,height:400});
				}
				else{
					alert(ajaxobj.info);		
				}
			},
			error:function(){
				alert("操作失败");
			}
		});
		
	}
</script>
<include file="Public:footer" />